﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorFEProperties.h
 * @brief  VAOne读写FE属性适配器
 *
 * @author  lilongyuan (lilongyuan@diso.cn)
 * @date    2025-02-26
 *********************************************************************/
#ifndef VAONEXMLADAPTORFEPROPERTIES_H
#define VAONEXMLADAPTORFEPROPERTIES_H

#include "FITKAbstractVAOneXMLAdaptor.h"

namespace Interface
{
    class FITKAbaSectionShellHomogeneous;
}

namespace IO
{
    /**
     * @brief   VAOne读写FE属性适配器
     * @author  lilongyuan (lilongyuan@diso.cn)
     * @date    2025-02-26
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorFEProperties : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorFEProperties);
    public:
        /**
         * @brief   构造函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-26
         */
        explicit VAOneXMLAdaptorFEProperties() = default;
        /**
         * @brief   析构函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-26
         */
        ~VAOneXMLAdaptorFEProperties() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-26
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-26
         */
        bool adaptW() override;
    private:
        /**
         * @brief     读取FE属性数据
         * @param[i]  node FEProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-26
         */
        bool readFEProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief     写出单条FE属性数据
         * @param[i]  node FEProperty节点，data 均匀材料壳截面属性数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-26
         */
        bool writeFEProperty(rapidxml::xml_node<char>* node, Interface::FITKAbaSectionShellHomogeneous* data);
        /**
         * @brief     写出颜色数据
         * @param[i]  node FEProperty节点
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-26
         */
        bool writeColor(rapidxml::xml_node<char>* node);
    };

    Register2FITKIOAdaptorFactory(VAOneXML, FEProperties, VAOneXMLAdaptorFEProperties)
}

#endif // VAONEXMLADAPTORFEPROPERTIES_H